package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by VegetaKo on 2017/1/3.
 */
@DynamicInsert
@Entity
@Table(name = "mall_good_category", catalog = "")
public class MallGoodCategory extends BaseEntity {
    private String goodCategroyCode;
    private String name;
    private String logo;

    @Basic
    @Column(name = "good_categroy_code", nullable = true, length = 16)
    public String getGoodCategroyCode() {
        return goodCategroyCode;
    }

    public void setGoodCategroyCode(String goodCategroyCode) {
        this.goodCategroyCode = goodCategroyCode;
    }

    @Basic
    @Column(name = "name", nullable = true, length = 64)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "logo", nullable = true, length = 128)
    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MallGoodCategory that = (MallGoodCategory) o;

        if (goodCategroyCode != null ? !goodCategroyCode.equals(that.goodCategroyCode) : that.goodCategroyCode != null)
            return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (logo != null ? !logo.equals(that.logo) : that.logo != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = goodCategroyCode != null ? goodCategroyCode.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (logo != null ? logo.hashCode() : 0);
        return result;
    }
}
